"""
https://pyecharts.org/#/zh-cn/intro
https://gallery.pyecharts.org/#/
pip install pyecharts
"""
from pyecharts.charts import Line
from pyecharts.options import TitleOpts,LegendOpts,ToolboxOpts,VisualMapOpts
# 一:基础折线图
# 1。得到折线图对象
line = Line()
# 2. 添加x轴数据
line.add_xaxis(["中国","美国","日本"])
# 3.添加y轴数据
line.add_yaxis("GDP",[30,20,15])
# 4.生成图标
# line.render()

# 二 设置全局配置项
line.set_global_opts(
    title_opts = TitleOpts(title="GDP展示",pos_left="center",pos_bottom="1%"),
    legend_opts=LegendOpts(is_show = True),
    toolbox_opts=ToolboxOpts(is_show=True),
    visualmap_opts = VisualMapOpts(is_show=True)
)

line.render()